/**	\author    coidgen 0.9.2
	\version    (27.0 build 81)
	\date      
	\brief     
*/



// Service header info (for version checking),  ! DO NOT CHANGE !
static const char COID_bin_data[] =
"060005000000302E392E3209000000312E342028342E3029A2250000205AD4450000000000000000001B000051000000"
"1C000000010000000900000054657374436C617373000000000000000000000000100000001000000010000000FFFFFF"
"FF040000006F7063640000000000000000000080000000000A0000006765745F6C656E6774680000000002000000FFFF"
"FFFF03000000696E74000000000000000000000208000000FFFFFFFF11000000636F6E7374207374643A3A737472696E"
"67000000000000000000001108000000000207200000000000000000FFFFFFFF040000006F7063640000000000000000"
"000080000000000F0000006765745F766563745F6C656E6774680100000002000000FFFFFFFF03000000696E74000000"
"000000000000000208000000FFFFFFFF1C000000636F6E7374207374643A3A766563746F723C7472697654797065733E"
"000000000000000000001108000000000207200000000000000000FFFFFFFF040000006F706364000000000000000000"
"008000000000080000006D756C7469706C790200000003000000FFFFFFFF06000000646F75626C650000000000000000"
"00000100000000FFFFFFFF06000000646F75626C65000000000000000000000100000000FFFFFFFF06000000646F7562"
"6C65000000000000000000000208000000000207200000000000000000FFFFFFFF040000006F70636400000000000000"
"0000008000000000070000006164645F6F6E650300000001000000FFFFFFFF03000000696E7400000000000000000000"
"0408000000000207200000000000000000FFFFFFFF040000006F7063640000000000000000000080000000000A000000"
"7365745F7374617475730400000002000000FFFFFFFF03000000696E74000000000000000000000208000000FFFFFFFF"
"03000000696E74000000000000000000000100000000000207200000000000000000FFFFFFFF040000006F7063640000"
"000000000000000080000000000E0000007365745F62697274685F646174650500000001000000FFFFFFFF1900000073"
"74643A3A766563746F723C2062697274685F64617465203E000000000000000000000108000000000207000000000000"
"000000FFFFFFFF040000006F7063640000000000000000000080000000000A000000636D706C785F6D65746806000000"
"03000000FFFFFFFF120000007374643A3A766563746F723C636D706C783E000000000000000000000208000000FFFFFF"
"FF05000000636F6C6F72000000000000000000000208000000FFFFFFFF03000000696E74000000000000000000000208"
"000000000207000000000000000000FFFFFFFF040000006F7063640000000000000000000080000000000D000000636D"
"706C785F6D6574685F696E0700000003000000FFFFFFFF120000007374643A3A766563746F723C636D706C783E000000"
"000000000000000108000000FFFFFFFF05000000636F6C6F72000000000000000000000108000000FFFFFFFF03000000"
"696E74000000000000000000000108000000000207000000000000000000FFFFFFFF040000006F706364000000000000"
"0000000080000000000C00000061727261795F6F665F696E740800000001000000FFFFFFFF100000007374643A3A7665"
"63746F723C696E743E000000000000000000000100000000000207000000000000000000FFFFFFFF040000006F706364"
"000000000000000000008000000000110000006765745F737472696E675F766563746F720900000001000000FFFFFFFF"
"180000007374643A3A766563746F723C7374643A3A737472696E673E0000000000000000000002080000000002072000"
"00000000000000FFFFFFFF040000006F706364000000000000000000008000000000110000007365745F737472696E67"
"5F766563746F720A00000001000000FFFFFFFF180000007374643A3A766563746F723C7374643A3A737472696E673E00"
"0000000000000000000108000000000207200000000000000000FFFFFFFF040000006F70636400000000000000000000"
"8000000000190000007365745F76765F636D706C785F616E645F74726976547970650B00000002000000FFFFFFFF2000"
"00007374643A3A766563746F723C7374643A3A766563746F723C636D706C783E203E0000000000000000000001080000"
"00FFFFFFFF240000007374643A3A766563746F723C7374643A3A766563746F723C7472697654797065733E203E000000"
"000000000000000108000000000207200000000000000000FFFFFFFF040000006F706364000000000000000000008000"
"000000190000006765745F76765F636D706C785F616E645F74726976547970650C00000002000000FFFFFFFF20000000"
"7374643A3A766563746F723C7374643A3A766563746F723C636D706C783E203E000000000000000000000208000000FF"
"FFFFFF240000007374643A3A766563746F723C7374643A3A766563746F723C7472697654797065733E203E0000000000"
"00000000000208000000000207200000000000000000FFFFFFFF040000006F7063640000000000000000000080000000"
"00110000007365745F706572736F6E616C5F646174610D00000001000000FFFFFFFF06000000706572736F6E00000000"
"0000000000000108000000000207200000000000000000FFFFFFFF040000006F70636400000000000000000000800000"
"00000B0000007365745F616464726573730E00000001000000FFFFFFFF0E000000616464726573735F73747275637400"
"0000000000000000000108000000000207200000000000000000FFFFFFFF040000006F70636400000000000000000000"
"80000000000900000063616C63756C6174650F00000001000000FFFFFFFF0A00000063616C63756C61746F7200000000"
"000000000000040800000000020720000000000000000001FFFFFFFF040000006F706364000000000000000000008000"
"0000000E0000006163636570745F636F6E6E6563740500008001000000FFFFFFFF03000000696E740000000000000000"
"0000010000000000028700000000000000000001FFFFFFFF040000006F70636400000000000000000000800000000015"
"0000006163636570745F636F6E6E6563745F736861726564060000800000000000508020000000000000000000000000"
"00000001000700FFFFFFFF00000000"
;
//*/


#include "coid/comm/interfnc.h"
#include "example.h"
#include "coid/comm/metastream/metastream.h"


namespace coid {


static inline const char ** COID_OUT_ARGS(const char ** from) {
	while( *from ) from++;
	return ++from;
}

typedef ServiceDescriptor::MethodDesc MethodDesc;
#define COID_MethodDesc_constructor(S,I,F)         MethodDesc( S[0], S[1], &S[2], COID_OUT_ARGS(&S[2]), I, F )
#define COID_MethodDesc_constructor_NotImpl        MethodDesc( NULL, NULL, NULL, NULL, 0, 0 )



typedef void (TestClass::*coid_fnc)();

/// fake function, should never be called:
static void coid_throw() {throw ersFE_EXCEPTION;}

/// we need type cast in case there are 2 or more methods with the same name
#define COID_DISPATCH_CREATE_HOOK(M,i,t,tc) \
	if( i < coid_fnc_count ) { \
		if( (coid_flags[i] & COID_TestClass_method_desc[i].flags & MethodDesc::xACCESS_MODE) ) \
			coid_fnc_table[t] = (coid_fnc) (tc) &TestClass::M; \
		else *(void **) &coid_fnc_table[t] = (void *) coid_throw; \
	}


#define COID_DISPATCH_CREATE_CALLER_HOOK(M,i,t) \
	if( i < coid_fnc_count ) { \
		if( (coid_flags[i] & COID_TestClass_method_desc[i].flags & MethodDesc::xACCESS_MODE) ) \
			coid_fnc_table[t] = (coid_fnc) &DISPATCH_CALLER_TestClass_27_0::M; \
		else *(void **) &coid_fnc_table[t] = (void *) coid_throw; \
	}






/// functions:
uint COID_TestClass_27_0_get_method_id( const token & name );
opcd COID_TestClass_27_0_dispatch( InstanceData * _coid_inst_data, uint _coid_fnc_id, binstream& _coid_bstr, metastream* coid_meta=0 );
metastream& COID_TestClass_27_0_getmeta();



struct DISPATCH_CALLER_TestClass_27_0
{
	void call_dispatch( binstream * b ) {
		COID_CLIENT_EXESTREAM_ARGS * a = (COID_CLIENT_EXESTREAM_ARGS *) this;
		InstanceData d;  d._object = a->obj;
		COID_TestClass_27_0_dispatch( &d, a->id, *b );
	}
};





enum {	/// command ids, format is: COID_classname_fncname_fncid
	COID_TestClass_get_length_0 = 0,
	COID_TestClass_get_vect_length_1 = 1,
	COID_TestClass_multiply_2 = 2,
	COID_TestClass_add_one_3 = 3,
	COID_TestClass_set_status_4 = 4,
	COID_TestClass_set_birth_date_5 = 5,
	COID_TestClass_cmplx_meth_6 = 6,
	COID_TestClass_cmplx_meth_in_7 = 7,
	COID_TestClass_array_of_int_8 = 8,
	COID_TestClass_get_string_vector_9 = 9,
	COID_TestClass_set_string_vector_10 = 10,
	COID_TestClass_set_vv_cmplx_and_trivType_11 = 11,
	COID_TestClass_get_vv_cmplx_and_trivType_12 = 12,
	COID_TestClass_set_personal_data_13 = 13,
	COID_TestClass_set_address_14 = 14,
	COID_TestClass_calculate_15 = 15,

    COID_TestClass_accept_connect_5,
    COID_TestClass_accept_connect_shared_6
};



/// info about every function:
static const char * COID_TestClass_get_length_0_finfo[] = {"get_length", "opcd ", "const std::string & str", NULL, "int & length", NULL};
static const char * COID_TestClass_get_vect_length_1_finfo[] = {"get_vect_length", "opcd ", "const std::vector<trivTypes> & vec", NULL, "int & length", NULL};
static const char * COID_TestClass_multiply_2_finfo[] = {"multiply", "opcd ", "double a", "double b", NULL, "double & result", NULL};
static const char * COID_TestClass_add_one_3_finfo[] = {"add_one", "opcd ", "int & number", NULL, "int & number", NULL};
static const char * COID_TestClass_set_status_4_finfo[] = {"set_status", "opcd ", "int new_status", NULL, "int & old_status", NULL};
static const char * COID_TestClass_set_birth_date_5_finfo[] = {"set_birth_date", "opcd ", "std::vector< birth_date > & birt_d", NULL, NULL};
static const char * COID_TestClass_cmplx_meth_6_finfo[] = {"cmplx_meth", "opcd ", NULL, "std::vector<cmplx> & smthg_out", "color & colorstruct", "int & number_out", NULL};
static const char * COID_TestClass_cmplx_meth_in_7_finfo[] = {"cmplx_meth_in", "opcd ", "std::vector<cmplx> & smthg_in", "color & colorstruct", "int & number_in", NULL, NULL};
static const char * COID_TestClass_array_of_int_8_finfo[] = {"array_of_int", "opcd ", "std::vector<int> int_array", NULL, NULL};
static const char * COID_TestClass_get_string_vector_9_finfo[] = {"get_string_vector", "opcd ", NULL, "std::vector<std::string> & string_vector_out", NULL};
static const char * COID_TestClass_set_string_vector_10_finfo[] = {"set_string_vector", "opcd ", "std::vector<std::string> & string_vector_in", NULL, NULL};
static const char * COID_TestClass_set_vv_cmplx_and_trivType_11_finfo[] = {"set_vv_cmplx_and_trivType", "opcd ", "std::vector<std::vector<cmplx> > & vv_cmplx_in", "std::vector<std::vector<trivTypes> > & vv_trivTypes_in", NULL, NULL};
static const char * COID_TestClass_get_vv_cmplx_and_trivType_12_finfo[] = {"get_vv_cmplx_and_trivType", "opcd ", NULL, "std::vector<std::vector<cmplx> > & vv_cmplx_out", "std::vector<std::vector<trivTypes> > & vv_trivTypes_out", NULL};
static const char * COID_TestClass_set_personal_data_13_finfo[] = {"set_personal_data", "opcd ", "person & person_in_out", NULL, NULL};
static const char * COID_TestClass_set_address_14_finfo[] = {"set_address", "opcd ", "address_struct & address", NULL, NULL};
static const char * COID_TestClass_calculate_15_finfo[] = {"calculate", "opcd ", "calculator & calcul_in_out", NULL, "calculator & calcul_in_out", NULL};
static const char * COID_TestClass_accept_connect_5_finfo[] = {"accept_connect", "opcd ", "int status_init", NULL, NULL};
static const char * COID_TestClass_accept_connect_shared_6_finfo[] = {"accept_connect_shared", "opcd ", NULL, NULL};


/// create structure that holds everything about function:
static const MethodDesc COID_TestClass_method_desc[] = {
	COID_MethodDesc_constructor( COID_TestClass_get_length_0_finfo, 0, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_get_vect_length_1_finfo, 1, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_multiply_2_finfo, 2, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_add_one_3_finfo, 3, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_set_status_4_finfo, 4, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_set_birth_date_5_finfo, 5, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_cmplx_meth_6_finfo, 6, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_cmplx_meth_in_7_finfo, 7, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_array_of_int_8_finfo, 8, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_get_string_vector_9_finfo, 9, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_set_string_vector_10_finfo, 10, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_set_vv_cmplx_and_trivType_11_finfo, 11, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_get_vv_cmplx_and_trivType_12_finfo, 12, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_set_personal_data_13_finfo, 13, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_set_address_14_finfo, 14, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_calculate_15_finfo, 15, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_accept_connect_5_finfo, 2147483653, MethodDesc::fACCESS_MODE_DIRECT | MethodDesc::fACCESS_MODE_INTERPROCESS | MethodDesc::fACCESS_MODE_REMOTE | MethodDesc::fMETA | MethodDesc::fLOG_CALL ),
	COID_MethodDesc_constructor( COID_TestClass_accept_connect_shared_6_finfo, 2147483654, MethodDesc::fLOG_CALL )
};



static const char * COID_dependencies_TestClass[] = {

	NULL
};


/// ServiceDescriptor:
static ServiceDescriptor COID_descriptor_TestClass;



/// dispatch stores function tables for all 'direct' clients with different minor versions here
class COID_register_TestClass_27_0
{
	struct table {
		uint ver;
		coid_fnc * tbl;
	};
	dynarray<table>	_tables;

public:
//	comm_mutex_rw	_mx;
	comm_mutex	_mx;
   const void* (*dummyreg)();

	COID_register_TestClass_27_0() {
		COID_descriptor_TestClass._version.set( "", 27, 0, 81 );
		COID_descriptor_TestClass._coid_version = COID_VERSION;
		COID_descriptor_TestClass._name = "TestClass";
		COID_descriptor_TestClass._shortname = "TestClas";
		COID_descriptor_TestClass._info = "";
		COID_descriptor_TestClass._dependencies = COID_dependencies_TestClass;
		COID_descriptor_TestClass._nmeth = 16;
		COID_descriptor_TestClass._methflags = COID_TestClass_method_desc;
		COID_descriptor_TestClass._flags = ServiceDescriptor::fLOG_CALL | ServiceDescriptor::fALLOW_DIRECT_ACCESS | ServiceDescriptor::fALLOW_INTERPROCESS_ACCESS | ServiceDescriptor::fALLOW_REMOTE_ACCESS | ServiceDescriptor::fAUTONOMOUS;
		COID_descriptor_TestClass._acceptor_port = (uint) -1;
		COID_descriptor_TestClass._bin_svc_data = COID_bin_data;
		COID_descriptor_TestClass.get_method_id = COID_TestClass_27_0_get_method_id;
		COID_descriptor_TestClass.dispatch = COID_TestClass_27_0_dispatch;
		COID_descriptor_TestClass._fnc_get_meta = COID_TestClass_27_0_getmeta;
#ifdef _DEBUG
		COID_descriptor_TestClass._flags |= ServiceDescriptor::fDEBUG;
#endif
		_mx.set_name( "COID_register_TestClass_27_0" );
		INTERFACE_REGISTER(ServiceDescriptor).add( &COID_descriptor_TestClass );
	}

	~COID_register_TestClass_27_0() {
//		MXGUARDRW( (comm_mutex_rw &) _mx );
		MXGUARD( (comm_mutex &) _mx );
		for( uint i=0; i<_tables.size(); i++ )
			delete [] _tables[i].tbl;
	}
	coid_fnc * get_table_notlocked( uint ver ) {
		for( uint i=0; i<_tables.size(); i++ )
			if( ver == _tables[i].ver ) return _tables[i].tbl;
		return NULL;
	}
	coid_fnc * get_table( uint ver ) {
//		MXGUARDRW( (const comm_mutex_rw &) _mx );		/// ==> read lock
		MXGUARD( (const comm_mutex &) _mx );
		return get_table_notlocked( ver );
	}
	void insert_table( uint ver, coid_fnc * tbl ) {
		table * t = _tables.add( 1 );	/// mutex has been locked
		t->ver = ver; t->tbl = tbl;
	}
};


// for dll linking
COID_register_TestClass_27_0 & get_COID_register_TestClass_27_0()
{
	static COID_register_TestClass_27_0 x;
	x.dummyreg = &coid_get_sdir2;    //force exporting the symbol
	x.dummyreg();
	return x;
}

//for static linking (must be called from outside to link this object)
void get_COID_register_TestClass()
{
	COID_register_TestClass_27_0();
}

static COID_register_TestClass_27_0 & COID_auto_register_variable = get_COID_register_TestClass_27_0();





metastream& COID_TestClass_27_0_getmeta()
{
    static metastream* meta = 0;
    if(meta)  return *meta;

    meta = new metastream;
    ServiceDescriptor::MethodDesc* med=0;
#define META_TD(TY)     metastream::TypeDesc< TY >::get_str(*meta)

    {   //COID_TestClass_accept_connect_5
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_accept_connect_5];
        med->retval.meta = META_TD(opcd);

		med->inargs[0].meta = META_TD(int);
    }
    {   //COID_TestClass_accept_connect_shared_6
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_descriptor_TestClass._nmeth+1];
        med->retval.meta = META_TD(opcd);
    }
    {   //COID_TestClass_get_length_0
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_get_length_0];
        med->retval.meta = META_TD(opcd);

		med->outargs[0].meta = META_TD(int);
		med->inargs[0].meta = META_TD(std::string);
    }
    {   //COID_TestClass_get_vect_length_1
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_get_vect_length_1];
        med->retval.meta = META_TD(opcd);

		med->outargs[0].meta = META_TD(int);
		med->inargs[0].meta = META_TD(std::vector<trivTypes>);
    }
    {   //COID_TestClass_multiply_2
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_multiply_2];
        med->retval.meta = META_TD(opcd);

		med->inargs[0].meta = META_TD(double);
		med->inargs[1].meta = META_TD(double);
		med->outargs[0].meta = META_TD(double);
    }
    {   //COID_TestClass_add_one_3
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_add_one_3];
        med->retval.meta = META_TD(opcd);

		med->inargs[0].meta = META_TD(int);
		med->outargs[0].meta = META_TD(int);
    }
    {   //COID_TestClass_set_status_4
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_set_status_4];
        med->retval.meta = META_TD(opcd);

		med->outargs[0].meta = META_TD(int);
		med->inargs[0].meta = META_TD(int);
    }
    {   //COID_TestClass_set_birth_date_5
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_set_birth_date_5];
        med->retval.meta = META_TD(opcd);

		med->inargs[0].meta = META_TD(std::vector< birth_date >);
    }
    {   //COID_TestClass_cmplx_meth_6
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_cmplx_meth_6];
        med->retval.meta = META_TD(opcd);

		med->outargs[0].meta = META_TD(std::vector<cmplx>);
		med->outargs[1].meta = META_TD(color);
		med->outargs[2].meta = META_TD(int);
    }
    {   //COID_TestClass_cmplx_meth_in_7
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_cmplx_meth_in_7];
        med->retval.meta = META_TD(opcd);

		med->inargs[0].meta = META_TD(std::vector<cmplx>);
		med->inargs[1].meta = META_TD(color);
		med->inargs[2].meta = META_TD(int);
    }
    {   //COID_TestClass_array_of_int_8
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_array_of_int_8];
        med->retval.meta = META_TD(opcd);

		med->inargs[0].meta = META_TD(std::vector<int>);
    }
    {   //COID_TestClass_get_string_vector_9
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_get_string_vector_9];
        med->retval.meta = META_TD(opcd);

		med->outargs[0].meta = META_TD(std::vector<std::string>);
    }
    {   //COID_TestClass_set_string_vector_10
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_set_string_vector_10];
        med->retval.meta = META_TD(opcd);

		med->inargs[0].meta = META_TD(std::vector<std::string>);
    }
    {   //COID_TestClass_set_vv_cmplx_and_trivType_11
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_set_vv_cmplx_and_trivType_11];
        med->retval.meta = META_TD(opcd);

		med->inargs[0].meta = META_TD(std::vector<std::vector<cmplx> >);
		med->inargs[1].meta = META_TD(std::vector<std::vector<trivTypes> >);
    }
    {   //COID_TestClass_get_vv_cmplx_and_trivType_12
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_get_vv_cmplx_and_trivType_12];
        med->retval.meta = META_TD(opcd);

		med->outargs[0].meta = META_TD(std::vector<std::vector<cmplx> >);
		med->outargs[1].meta = META_TD(std::vector<std::vector<trivTypes> >);
    }
    {   //COID_TestClass_set_personal_data_13
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_set_personal_data_13];
        med->retval.meta = META_TD(opcd);

		med->inargs[0].meta = META_TD(person);
    }
    {   //COID_TestClass_set_address_14
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_set_address_14];
        med->retval.meta = META_TD(opcd);

		med->inargs[0].meta = META_TD(address_struct);
    }
    {   //COID_TestClass_calculate_15
        med = (ServiceDescriptor::MethodDesc*)&COID_descriptor_TestClass._methflags[COID_TestClass_calculate_15];
        med->retval.meta = META_TD(opcd);

		med->inargs[0].meta = META_TD(calculator);
		med->outargs[0].meta = META_TD(calculator);
    }

    return *meta;
}



///////////////////////////////////////////////////////////////////////////////
opcd COID_TestClass_27_0_dispatch( InstanceData* _coid_inst_data, uint _coid_fnc_id, binstream& _coid_bstr, metastream* coid_meta )
{
	TestClass * _coid_TestClass_obj = (TestClass *) _coid_inst_data->_object;
	double _coid_TestClass_ticks = 0.0;
	binstream * _coid_log = NULL;
	opcd _coid_err_code = 0;

	switch( _coid_fnc_id ) {
		case StdDispatchMethod::CONSTRUCTOR: {
			_coid_inst_data->_object = _coid_TestClass_obj = new TestClass;
       } break;
		case StdDispatchMethod::POSTCONSTRUCTOR: {
			_coid_err_code = 0;
		} break;
		case StdDispatchMethod::DESTRUCTOR: {
			delete _coid_TestClass_obj; _coid_inst_data->_object = NULL;
		} break;
		case StdDispatchMethod::CREATE_INTERFACE: {
			CreateInterfaceInfo* coid_iface_info;
			_coid_bstr.read_ptr(coid_iface_info);
			const uint coid_fnc_count = coid_iface_info->_nmethods;
			const uint * coid_flags = coid_iface_info->_methflags;
			coid_fnc * coid_fnc_table = get_COID_register_TestClass_27_0().get_table( coid_iface_info->_clientver.get_minor() );

			if( !coid_fnc_table ) {
				//MXGUARDRW( get_COID_register_TestClass_27_0()._mx );
				MXGUARD( get_COID_register_TestClass_27_0()._mx );
				coid_fnc_table = get_COID_register_TestClass_27_0().get_table_notlocked( coid_iface_info->_clientver.get_minor() );
				if( !coid_fnc_table ) {
					coid_fnc_table = (coid_fnc *) new char[ sizeof(coid_fnc) * (coid_fnc_count + 1) ];	/// new coid_fnc[...] would allocate pointer to 0 bytes (M$ 'feature')
					memset( coid_fnc_table, 0, (coid_fnc_count + 1) * sizeof(coid_fnc) );
					uint coid_table_index = 0;

					((CreateInterfaceInfo::t_fnc *) coid_fnc_table)[coid_table_index++] = coid_iface_info->_disconnect_interface;
					COID_DISPATCH_CREATE_HOOK( get_length, 0, coid_table_index++, opcd (TestClass::*)( int & , const std::string &  ) )
					COID_DISPATCH_CREATE_HOOK( get_vect_length, 1, coid_table_index++, opcd (TestClass::*)( int & , const std::vector<trivTypes> &  ) )
					COID_DISPATCH_CREATE_HOOK( multiply, 2, coid_table_index++, opcd (TestClass::*)( double , double , double &  ) )
					COID_DISPATCH_CREATE_HOOK( add_one, 3, coid_table_index++, opcd (TestClass::*)( int &  ) )
					COID_DISPATCH_CREATE_HOOK( set_status, 4, coid_table_index++, opcd (TestClass::*)( int & , int  ) )
					COID_DISPATCH_CREATE_HOOK( set_birth_date, 5, coid_table_index++, opcd (TestClass::*)(std::vector< birth_date > & ) )
					COID_DISPATCH_CREATE_HOOK( cmplx_meth, 6, coid_table_index++, opcd (TestClass::*)(std::vector<cmplx> & , color & , int & ) )
					COID_DISPATCH_CREATE_HOOK( cmplx_meth_in, 7, coid_table_index++, opcd (TestClass::*)(std::vector<cmplx> & , color & , int & ) )
					COID_DISPATCH_CREATE_HOOK( array_of_int, 8, coid_table_index++, opcd (TestClass::*)(std::vector<int> ) )
					COID_DISPATCH_CREATE_HOOK( get_string_vector, 9, coid_table_index++, opcd (TestClass::*)( std::vector<std::string> &  ) )
					COID_DISPATCH_CREATE_HOOK( set_string_vector, 10, coid_table_index++, opcd (TestClass::*)( std::vector<std::string> &  ) )
					COID_DISPATCH_CREATE_HOOK( set_vv_cmplx_and_trivType, 11, coid_table_index++, opcd (TestClass::*)( std::vector<std::vector<cmplx> > & , std::vector<std::vector<trivTypes> > &  ) )
					COID_DISPATCH_CREATE_HOOK( get_vv_cmplx_and_trivType, 12, coid_table_index++, opcd (TestClass::*)( std::vector<std::vector<cmplx> > & , std::vector<std::vector<trivTypes> > &  ) )
					COID_DISPATCH_CREATE_HOOK( set_personal_data, 13, coid_table_index++, opcd (TestClass::*)( person &  ) )
					COID_DISPATCH_CREATE_HOOK( set_address, 14, coid_table_index++, opcd (TestClass::*)( address_struct &  ) )
					COID_DISPATCH_CREATE_HOOK( calculate, 15, coid_table_index++, opcd (TestClass::*)( calculator &  ) )

					get_COID_register_TestClass_27_0().insert_table( coid_iface_info->_clientver.get_minor(), coid_fnc_table );
				}
			}

			_coid_bstr.acknowledge();
			_coid_bstr.write_ptr( coid_fnc_table );
			_coid_bstr.write_ptr( _coid_inst_data->_object );
			_coid_bstr.write_ptr( coid_iface_info->_mutex );
		} break;
		case StdDispatchMethod::AUTHENTIFY: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			int status_init;
			if(coid_meta)  coid_meta->xstream_in(status_init, "status_init"); else  _coid_bstr >> status_init;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << "80000005" << ") accept_connect ( "; *_coid_log << status_init; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->accept_connect( status_init );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case StdDispatchMethod::AUTHENTIFY_SHARED: {
			_coid_bstr.acknowledge();
			_coid_bstr << _coid_err_code;
			return ersNOT_IMPLEMENTED;
		} break;
		case StdDispatchMethod::AUTHENTIFY_AUTO: {
			_coid_bstr.acknowledge();
			_coid_bstr << _coid_err_code;
			_coid_bstr.flush();
			return ersNOT_IMPLEMENTED;
		} break;
		case StdDispatchMethod::HANDLE_NET_LOOP: {
			return ersNOT_IMPLEMENTED;
		} break;
		case StdDispatchMethod::PREDESTRUCTOR: {
			_coid_bstr.acknowledge();
			_coid_bstr << _coid_err_code;
			_coid_bstr.flush();
			return ersNOT_IMPLEMENTED;
		} break;
		case StdDispatchMethod::COMMAND: {
			_coid_bstr.acknowledge();
			_coid_bstr << _coid_err_code;
			_coid_bstr.flush();
			return ersNOT_IMPLEMENTED;
		} break;
		case StdDispatchMethod::SPAWN: {
			_coid_bstr.acknowledge();
			_coid_bstr << _coid_err_code;
			_coid_bstr.flush();
			return ersNOT_IMPLEMENTED;
		} break;
		case StdDispatchMethod::ECHO: {
			_coid_bstr.acknowledge();
			_coid_bstr << _coid_err_code;
			_coid_bstr.flush();
			return ersNOT_IMPLEMENTED;
		} break;


		/// service-specific methods:
		case COID_TestClass_get_length_0: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			int length;
			std::string str;
			if(coid_meta)  coid_meta->xstream_in(str, "str"); else  _coid_bstr >> str;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_get_length_0 << ") get_length ( "; *_coid_log << "?"; *_coid_log << ", "; *_coid_log << str; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->get_length( length, str );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			if( ! _coid_err_code ) {
				if(coid_meta)  coid_meta->xstream_out( length, "length" );  else  _coid_bstr << length;
			}

			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << length; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_get_vect_length_1: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			int length;
			std::vector<trivTypes> vec;
			if(coid_meta)  coid_meta->xstream_in(vec, "vec"); else  _coid_bstr >> vec;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_get_vect_length_1 << ") get_vect_length ( "; *_coid_log << "?"; *_coid_log << ", "; *_coid_log << vec; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->get_vect_length( length, vec );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			if( ! _coid_err_code ) {
				if(coid_meta)  coid_meta->xstream_out( length, "length" );  else  _coid_bstr << length;
			}

			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << length; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_multiply_2: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			double a;
			if(coid_meta)  coid_meta->xstream_in(a, "a"); else  _coid_bstr >> a;
			double b;
			if(coid_meta)  coid_meta->xstream_in(b, "b"); else  _coid_bstr >> b;
			double result;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_multiply_2 << ") multiply ( "; *_coid_log << a; *_coid_log << ", "; *_coid_log << b; *_coid_log << ", "; *_coid_log << "?"; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->multiply( a, b, result );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			if( ! _coid_err_code ) {
				if(coid_meta)  coid_meta->xstream_out( result, "result" );  else  _coid_bstr << result;
			}

			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << result; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_add_one_3: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			int number;
			if(coid_meta)  coid_meta->xstream_in(number, "number"); else  _coid_bstr >> number;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_add_one_3 << ") add_one ( "; *_coid_log << number; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->add_one( number );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			if( ! _coid_err_code ) {
				if(coid_meta)  coid_meta->xstream_out( number, "number" );  else  _coid_bstr << number;
			}

			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << number; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_set_status_4: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			int old_status;
			int new_status;
			if(coid_meta)  coid_meta->xstream_in(new_status, "new_status"); else  _coid_bstr >> new_status;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_set_status_4 << ") set_status ( "; *_coid_log << "?"; *_coid_log << ", "; *_coid_log << new_status; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->set_status( old_status, new_status );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			if( ! _coid_err_code ) {
				if(coid_meta)  coid_meta->xstream_out( old_status, "old_status" );  else  _coid_bstr << old_status;
			}

			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << old_status; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_set_birth_date_5: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			std::vector< birth_date > birt_d;
			if(coid_meta)  coid_meta->xstream_in(birt_d, "birt_d"); else  _coid_bstr >> birt_d;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_set_birth_date_5 << ") set_birth_date ( "; *_coid_log << birt_d; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->set_birth_date( birt_d );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			
			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_cmplx_meth_6: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			std::vector<cmplx> smthg_out;
			color colorstruct;
			int number_out;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_cmplx_meth_6 << ") cmplx_meth ( "; *_coid_log << "?"; *_coid_log << ", "; *_coid_log << "?"; *_coid_log << ", "; *_coid_log << "?"; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->cmplx_meth( smthg_out, colorstruct, number_out );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			if( ! _coid_err_code ) {
				if(coid_meta)  coid_meta->xstream_out( smthg_out, "smthg_out" );  else  _coid_bstr << smthg_out;
				if(coid_meta)  coid_meta->xstream_out( colorstruct, "colorstruct" );  else  _coid_bstr << colorstruct;
				if(coid_meta)  coid_meta->xstream_out( number_out, "number_out" );  else  _coid_bstr << number_out;
			}

			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << smthg_out; *_coid_log << ", "; *_coid_log << colorstruct; *_coid_log << ", "; *_coid_log << number_out; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_cmplx_meth_in_7: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			std::vector<cmplx> smthg_in;
			if(coid_meta)  coid_meta->xstream_in(smthg_in, "smthg_in"); else  _coid_bstr >> smthg_in;
			color colorstruct;
			if(coid_meta)  coid_meta->xstream_in(colorstruct, "colorstruct"); else  _coid_bstr >> colorstruct;
			int number_in;
			if(coid_meta)  coid_meta->xstream_in(number_in, "number_in"); else  _coid_bstr >> number_in;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_cmplx_meth_in_7 << ") cmplx_meth_in ( "; *_coid_log << smthg_in; *_coid_log << ", "; *_coid_log << colorstruct; *_coid_log << ", "; *_coid_log << number_in; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->cmplx_meth_in( smthg_in, colorstruct, number_in );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			
			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_array_of_int_8: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			std::vector<int> int_array;
			if(coid_meta)  coid_meta->xstream_in(int_array, "int_array"); else  _coid_bstr >> int_array;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_array_of_int_8 << ") array_of_int ( "; *_coid_log << int_array; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->array_of_int( int_array );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			
			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_get_string_vector_9: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			std::vector<std::string> string_vector_out;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_get_string_vector_9 << ") get_string_vector ( "; *_coid_log << "?"; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->get_string_vector( string_vector_out );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			if( ! _coid_err_code ) {
				if(coid_meta)  coid_meta->xstream_out( string_vector_out, "string_vector_out" );  else  _coid_bstr << string_vector_out;
			}

			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << string_vector_out; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_set_string_vector_10: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			std::vector<std::string> string_vector_in;
			if(coid_meta)  coid_meta->xstream_in(string_vector_in, "string_vector_in"); else  _coid_bstr >> string_vector_in;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_set_string_vector_10 << ") set_string_vector ( "; *_coid_log << string_vector_in; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->set_string_vector( string_vector_in );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			
			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_set_vv_cmplx_and_trivType_11: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			std::vector<std::vector<cmplx> > vv_cmplx_in;
			if(coid_meta)  coid_meta->xstream_in(vv_cmplx_in, "vv_cmplx_in"); else  _coid_bstr >> vv_cmplx_in;
			std::vector<std::vector<trivTypes> > vv_trivTypes_in;
			if(coid_meta)  coid_meta->xstream_in(vv_trivTypes_in, "vv_trivTypes_in"); else  _coid_bstr >> vv_trivTypes_in;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_set_vv_cmplx_and_trivType_11 << ") set_vv_cmplx_and_trivType ( "; *_coid_log << vv_cmplx_in; *_coid_log << ", "; *_coid_log << vv_trivTypes_in; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->set_vv_cmplx_and_trivType( vv_cmplx_in, vv_trivTypes_in );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			
			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_get_vv_cmplx_and_trivType_12: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			std::vector<std::vector<cmplx> > vv_cmplx_out;
			std::vector<std::vector<trivTypes> > vv_trivTypes_out;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_get_vv_cmplx_and_trivType_12 << ") get_vv_cmplx_and_trivType ( "; *_coid_log << "?"; *_coid_log << ", "; *_coid_log << "?"; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->get_vv_cmplx_and_trivType( vv_cmplx_out, vv_trivTypes_out );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			if( ! _coid_err_code ) {
				if(coid_meta)  coid_meta->xstream_out( vv_cmplx_out, "vv_cmplx_out" );  else  _coid_bstr << vv_cmplx_out;
				if(coid_meta)  coid_meta->xstream_out( vv_trivTypes_out, "vv_trivTypes_out" );  else  _coid_bstr << vv_trivTypes_out;
			}

			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << vv_cmplx_out; *_coid_log << ", "; *_coid_log << vv_trivTypes_out; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_set_personal_data_13: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			person person_in_out;
			if(coid_meta)  coid_meta->xstream_in(person_in_out, "person_in_out"); else  _coid_bstr >> person_in_out;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_set_personal_data_13 << ") set_personal_data ( "; *_coid_log << person_in_out; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->set_personal_data( person_in_out );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			
			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_set_address_14: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			address_struct address;
			if(coid_meta)  coid_meta->xstream_in(address, "address"); else  _coid_bstr >> address;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_set_address_14 << ") set_address ( "; *_coid_log << address; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->set_address( address );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			
			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;
		case COID_TestClass_calculate_15: {
			if( (_coid_inst_data->_flags & (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION)) == (MethodDesc::fLOG_CALL | MethodDesc::fLOG_DURATION) )
				_coid_TestClass_ticks = SINGLETON(HPTIMER).ftime();
			
			calculator calcul_in_out;
			if(coid_meta)  coid_meta->xstream_in(calcul_in_out, "calcul_in_out"); else  _coid_bstr >> calcul_in_out;

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				_coid_log = &_coid_inst_data->_cmdin->post_method();
				*_coid_log << "(" << COID_TestClass_calculate_15 << ") calculate ( "; *_coid_log << calcul_in_out; *_coid_log << " )";
			}

			_coid_bstr.acknowledge();

			_coid_err_code = _coid_TestClass_obj->calculate( calcul_in_out );
			if(coid_meta)  coid_meta->xstream_out(_coid_err_code,"err");  else  _coid_bstr << _coid_err_code;
			if( ! _coid_err_code ) {
				if(coid_meta)  coid_meta->xstream_out( calcul_in_out, "calcul_in_out" );  else  _coid_bstr << calcul_in_out;
			}

			_coid_bstr.flush();

			if( _coid_inst_data->_flags & MethodDesc::fLOG_CALL ) {
				*_coid_log << "  -->  ("; *_coid_log << calcul_in_out; *_coid_log << ")";
				if( _coid_inst_data->_flags & MethodDesc::fLOG_DURATION )
					*_coid_log << " [" << (SINGLETON(HPTIMER).ftime() - _coid_TestClass_ticks) * 1000 << "]";
				if( !_coid_err_code ) *_coid_log << " .. ok" << EOM;
				else *_coid_log << " .. fail: " << opcd_formatter(_coid_err_code) << EOM;
			}
			
		} break;


		default:
			_coid_bstr.acknowledge( true );
			_coid_bstr << ersNOT_IMPLEMENTED;
			_coid_bstr.flush();
			return ersNOT_IMPLEMENTED;
		break;
	}



	return _coid_err_code;
}












/// method table
static METHOD_TABLE COID_TestClass_method_table[] = {
	{"get_vect_length", COID_TestClass_get_vect_length_1},
	{"get_string_vector", COID_TestClass_get_string_vector_9},
	{NULL, UMAX},
	{NULL, UMAX},
	{"cmplx_meth_in", COID_TestClass_cmplx_meth_in_7},
	{NULL, UMAX},
	{"get_vv_cmplx_and_trivType", COID_TestClass_get_vv_cmplx_and_trivType_12},
	{"get_length", COID_TestClass_get_length_0},
	{NULL, UMAX},
	{"set_string_vector", COID_TestClass_set_string_vector_10},
	{"set_personal_data", COID_TestClass_set_personal_data_13},
	{NULL, UMAX},
	{"set_status", COID_TestClass_set_status_4},
	{NULL, UMAX},
	{"set_vv_cmplx_and_trivType", COID_TestClass_set_vv_cmplx_and_trivType_11},
	{"calculate", COID_TestClass_calculate_15},
	{"set_birth_date", COID_TestClass_set_birth_date_5},
	{"multiply", COID_TestClass_multiply_2},
	{"cmplx_meth", COID_TestClass_cmplx_meth_6},
	{"array_of_int", COID_TestClass_array_of_int_8},
	{"add_one", COID_TestClass_add_one_3},
	{"set_address", COID_TestClass_set_address_14},
	{NULL, UMAX},
	{NULL, UMAX}
};



#define COID_dispatch_method_size		(sizeof(COID_TestClass_method_table) / sizeof(METHOD_TABLE))



uint COID_TestClass_27_0_get_method_id( const token & name )
{
	hash<token> mha;
	uints idx = mha(name) % COID_dispatch_method_size;

	for( uint i=0; i<COID_dispatch_method_size; i++ ) {
		if( COID_TestClass_method_table[idx].name )
			if( name == COID_TestClass_method_table[idx].name )
				return COID_TestClass_method_table[idx].id;
		idx++;
		if( idx == COID_dispatch_method_size ) idx = 0;
	}

	return UMAX;
}


} // namespace coid
